import { createStore } from 'vuex'
import menu from './modules/menu/menu';
import role from './modules/role/role';
import admin from './modules/admin/admin';

let userinfo: any = sessionStorage.getItem('userInfo');

export default createStore({
  state: {
    userInfo: userinfo ? JSON.parse(userinfo) : null
  },
  getters: {
  },
  mutations: {
    changeUserInfo(state, data) {
      state.userInfo = data;
    }
  },
  actions: {

  },
  modules: {
    menu,
    role,
    admin
  }
})
